<template>
  <div class="container">
    <el-tree :data="tableData" :props="defaultProps">
      <span class="custom-tree-node" slot-scope="{ node, data }">
        <span>
          <i v-if="data.ISONLINE==='1'" class="el-icon-success" style="color:green"></i>
          <i v-if="data.ISONLINE==='0'" class="el-icon-warning-outline"></i>
          <i v-if="data.ISONLINE==='2'" class="el-icon-folder"></i>
          {{ node.label }}
          <i v-if="data.ISONLINE==='2'" >{{ '( ' + data.CNUM + ' / ' + data.ANUM + ' )' }}</i>
          </span>
      </span>
    </el-tree>
  </div>
  <!-- CLIENT_NAME	CNUM	ANUM	SYMBOL	ISONLINE	CLIENT_NO -->
</template>

<script>
import '@/assets/css/common.css'
export default {
  data () {
    return {
      currentPage: 1, //初始页
      pageSize: 10,    //    每页的数据
      tableData: [],
      defaultProps: {
        children: 'subs',
        label: 'CLIENT_NAME'
      }
    }
  },
  mounted () {
    this.getlistdata()
  },
  methods: {
    async getlistdata () {
      // var url = 'http://192.168.1.113:8000/Cityscapeapi/Vehicle/GetGroupTreeList?ClientNo=0000004&TYPE=机扫'
      // var url = 'Vehicle/GetGroupTreeList?ClientNo=00000&TYPE=机扫'
      var url = 'Vehicle/GetGroupTreeList?TYPE=机扫&ClientNo=' + localStorage.getItem('CLIENT_NO')
      const { data } = await this.$Http.get(url)
      // 原始数据
      this.tableData = data
    },
  }
}
</script>
<style>
.content {
  overflow-y: scroll;
}
</style>